﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Frontend.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Thông tin
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Partner obj = (Partner)ViewData.Model;
       List<sp_GetPartnerAddressListResult> listAddress = (List<sp_GetPartnerAddressListResult>)ViewData["PartnerAddesssList"];
       sp_GetMainPartnerAddressResult objMainAddress = (sp_GetMainPartnerAddressResult)ViewData["MainPartnerAddesss"]; %>
    <div class="boxs">
        <div class="ct">
            <div class="title">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td class="text">
                            Đối tác
                        </td>
                        <td class="icon">
                            <a href="#" class="list"></a><a href="#" class="thumb active"></a>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="bsearch">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <input type="text" value="" />
                        </td>
                       <td>
                            <%=Html.DropDownList("ProvinceList", null, Constants.CATEGORY_FIRST_PROVINCE, new {@style="width:140px" })%>
                        </td>
                        <td>
                            <%=Html.DropDownList("DistrictList", null, Constants.CATEGORY_FIRST_DISTRICT, new { @style = "width:160px" })%>
                        </td>
                        <td>
                            <img src="/themes/images/boxs-btn-s.png" onclick="alert('search');">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="ccat">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td class="ccat-lft">
                    <div class="cat-header">
                        <span>Danh mục</span>
                    </div>
                    <div class="cat-item">
                        <ul>
                            <%List<Category> categoryList = (List<Category>)ViewData["CategoryList"];
                              foreach (Category category in categoryList)
                              {%>
                            <li><a href="<%=FRouter._("danhmuc",category.ID.ToString(),category.CategoryName) %>">
                                <%=category.CategoryName %></a></li>
                            <% }
                            %>
                        </ul>
                    </div>
                    <div class="adv-lft">
                        <ul>
                            <li>
                                <img src="/themes/images/adv1.png" />
                            </li>
                            <li>
                                <img src="/themes/images/adv1.png" />
                            </li>
                        </ul>
                    </div>
                </td>
                <td class="ccat-rgh">
                    <div class="ccat-breadcrumb">
                        <a href="#">Nhà hàng - Quán ăn</a> > <a href="#">Tp HCM</a> > Q1
                    </div>
                    <div class="detail-partner">
                        <div class="box">
                            <div class="pd-icon-top">
                            </div>
                            <div class="pname">
                                <%= obj.Logo %></div>
                            <div>
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td class="plogo">
                                            <img src="<%=Constants.UPLOAD_CATEGORY_PATH + obj.Image%>" width="120" height="100" />
                                        </td>
                                        <td>
                                            <div class="minfo">
                                                <p>
                                                    <%= objMainAddress.Address %></p>
                                                <p>
                                                    <span>Ðiện thoại:</span><%= objMainAddress.Phone %></p>
                                                <p>
                                                    <span>Email:</span><%= obj.Email %></p>
                                                <p>
                                                    <span>Website:</span><%= obj.Webiste %></p>
                                                <p>
                                                    <span>Giảm giá:</span><b class="pdown"><%= obj.DiscountInfo %></b></p>
                                                <p>
                                                    <a href="#km" class="promotion">+ Xem chương trình khuyến mãi</a></p>
                                                <a href="/dang-ky-so-huu-the-sinh-vien.html">
                                                    <img src="/themes/images/btn-register-card.png" /></a>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="branch">
                                <div class="title">
                                    Các chi nhánh</div>
                                <% int i = 1;
                                   foreach (sp_GetPartnerAddressListResult item in listAddress)
                                   {%>
                                <div class="item">
                                    <p>
                                        <b>Chi nhánh
                                            <%=i %></b></p>
                                    <p>
                                        <%= item.Address +" , " + item.DistrictName + " , " + item.ProvinceName %><br />
                                        Điện thoại:<%= item.Phone %></p>
                                </div>
                                <%i++;
                                   } %>
                            </div>
                            <div class="clrfix">
                            </div>
                        </div>
                        <div class="box">
                            <div class="ptitle">
                                Giới thiệu
                            </div>
                            <div class="pcontent">
                                <p>
                                    <%=obj.Description %></p>
                            </div>
                        </div>
                        <div class="box">
                            <div class="ptitle">
                                Hình ảnh
                            </div>
                            <div class="pcontent">
                                <%List<Gallery> listGallery = (List<Gallery>)ViewData["PartnerGallery"];
                                  Gallery firstGallery = new Gallery();
                                  if (listGallery.Count > 0)
                                  {
                                      firstGallery = listGallery[0];%>
                                <div class="bigimg">
                                    <img src="<%=Constants.UPLOAD_IMAGE_PATH + firstGallery.Image%>" width="400" height="300" /></div>
                                <div class="smallimg">
                                    <ul>
                                        <%
                                            foreach (Gallery gallery in listGallery)
                                            {%>
                                        <li>
                                            <img src="<%=Constants.UPLOAD_IMAGE_PATH + gallery.Image%>" width="100" height="100" /></li>
                                        <%} %>
                                    </ul>
                                </div>
                                <% }
                                %>
                                <div class="clrfix">
                                </div>
                            </div>
                        </div>
                        <div class="box">
                            <div class="ptitle">
                                Khuyến mãi
                            </div>
                            <div class="pcontent">
                                <% List<Promotion> listPromotion = (List<Promotion>)ViewData["PartnerPromotion"];
                                   int promotionIndex = 1;
                                   foreach (Promotion promotion in listPromotion)
                                   {%>
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td class="ol-promotion">
                                            <span>
                                                <%=promotionIndex%></span>
                                        </td>
                                        <td class="if-promotion">
                                            <p>
                                                <%= promotion.PromotionInfo %></p>
                                        </td>
                                    </tr>
                                </table>
                                <% promotionIndex++;
                                    }
                                %>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ProvinceList").change(function () {
                var provinceID = $("#ProvinceList").val();
                $("#DistrictList").html("");
                $("#DistrictList").append($("<option value=''><%= Constants.CATEGORY_FIRST_PROVINCE %></option>"));
                if (provinceID != 0) {
                    $.getJSON('/Library/GenericHandle/DropdownListHandler.ashx?ID=' + provinceID + '&Page=District', function (item) {
                        $.each(item, function () {
                            $("#DistrictList").append($("<option value='" + this['ID'] + "'>" + this['Name'] + "</option>"));
                        });
                    });
                }
            });
        });
    </script>
</asp:Content>
